<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>{{ product_name }}</title>
     <link rel="stylesheet" href="https://ttresource.oss-cn-beijing.aliyuncs.com/handupload/video.css">
    <link rel="stylesheet" href="https://cdn.bootcss.com/Swiper/4.2.0/css/swiper.min.css">
    <style>
        body, html{font-family: PingFangSC-Regular, sans-serif;}
        body, h1, h2, h3, h4, h5, h6, hr, p, blockquote, dl, dt, dd, ul, ol, li, pre, form, fieldset, legend, button, input, textarea, th, td { margin:0; padding:0; }
        body, button, input, select, textarea { font:12px/1.5tahoma, arial, \5b8b\4f53; }
        h1, h2, h3, h4, h5, h6{ font-size:100%; }
        address, cite, dfn, em, var { font-style:normal; }
        code, kbd, pre, samp { font-family:couriernew, courier, monospace; }
        small{ font-size:12px; }
        ul, ol { list-style:none; }
        a { text-decoration:none; }
        a:hover { text-decoration:underline; }
        sup { vertical-align:text-top; }
        sub{ vertical-align:text-bottom; }
        legend { color:#000; }
        fieldset, img { border:0; }
        button, input, select, textarea { font-size:100%; }
        table { border-collapse:collapse; border-spacing:0; }
        a {
            text-decoration: none;//去掉下划线
            color: inherit;
            -webkit-user-select: none;
            -moz-user-select: none;
            user-select: none;
            -webkit-appearance: none;
            -webkit-text-size-adjust: none;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            -webkit-touch-callout: none;
            border-bottom: none;//去掉下边框（用text-decoration: none;没有用是时候加上）；
            display: block;
        }
        .line{
            width: 100%;
            height: 10px;
            background: #f3f3f3;
        }
        .bor_no{
            border: none!important;
        }
        .red_color{
            color: #FF4954!important;
        }
        .green_color{
			color: #2CBB45!important;
		}
        .FindDetails{
             width: 100%;
            /*height: 100%;*/
            position: absolute;
            left: 0;
            top: 0;
            background: #F3F3F3;
        }
        .downheader{
            width: 100%;
            height: 60px;
            background: #fff;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 10px;
            box-sizing: border-box;
            position: fixed;
            z-index: 99;
        }
        .logo_img{
            width: 127px;
            height: 41px;
        }
        .logo_img img{
            width: 100%;
            height: 100%;
            display: block;
        }
        .down_btn{
            width: 100px;
            height: 35px;
            border: 1px solid #ccc;
            border-radius: 4px;
            line-height: 37px;
            text-align: center;
            font-size: 14px;
            font-weight: 400;
            color: #000;
        }
        .share_data{
            width: 100%;
            /*height: 100%;*/
            background: #fff;
            margin-top: 60px;
        }
        .share_data_child{
            text-align: center;
        }
        .share_data_one{
            font-size: 40px;
            color: #2A2A2A;
            font-weight: 700;
            padding-top: 18px;
        }
        .share_data_two{
            font-size: 12px;
            color: #2A2A2A;
            font-weight: 400;
        }
        .share_data_three{
             font-size: 14px;
            color: #2A2A2A;
            font-weight: 500;
            padding-top: 13px;
            border-bottom: 1px solid #DFDFDF;
            padding-bottom: 13px;
        }
        .share_data_flex{
            display: flex;
            align-items: center;
            min-height: 70px;
        }
        .share_data_flex>div{
            width: 50%;
            text-align: center;
        }
        .share_data_flex>div:first-child{
            border-right: 1px solid #dfdfdf;
        }
        .share_data_flex_one{
            font-size: 24px;
            color: #6F757C;
            font-weight: 600;
        }
        .share_data_flex_two{
             font-size: 12px;
            color: #C3C3C3;
            font-weight: 400;
        }
        .share_data_flex_three{
             font-size: 24px;
            color: #FF4954;
            font-weight: 600;
            position: relative;
        }
        .share_data_flex_three img{
            width: 6px;
            height: 8px;
            margin-left: 5px;
            margin-bottom: 10px;
        }
        .share_data_flex_four{
             font-size: 12px;
            color: #C3C3C3;
            font-weight: 400;
        }
        .chazhuang{
            display: flex;
            justify-content: space-between;
            align-items: center;
            height: 62px;
            padding: 0 18px;
            background: #fff;
            margin: 10px 0;
        }
        .chazhuang_left{
            font-size: 14px;
            color: #6F757C;
            font-weight: 400;
        }
        .chazhuang_right{
            font-size: 14px;
            color: #2A2A2A;
            font-weight: 400;
        }
        .zhexiantu{
            padding: 18px;
            background: #fff;
        }
        .zhexianTab{
            font-size: 12px;
            color: #C3C3C3;
            font-weight: 500;
            margin-bottom: 18px;
            /* display: flex; */
            align-items: center;
            justify-content: space-between;
            height: 30px;
        }
        .zhexianTab div{
            /* float: left; */
        }
        .today{
            width: 40%;
            border: 1px solid #f3f3f3;
            text-align: center;
            height: 30px;
            line-height: 30px;
            border-radius: 4px;
            margin-right: 20px;
            float: left;
        }
        .other{
            width: 40%;
            display: flex;
            border: 2px solid #f3f3f3;
            text-align: center;
            height: 30px;
            line-height: 30px;
            border-radius: 4px;
        }
        .week{
            width: 24%;
            border: 2px solid #f3f3f3;
            text-align: center;
            height: 30px;
            line-height: 30px;
            border-top-right-radius: 4px;
            border-bottom-right-radius: 4px;
            float: right;
            border-left: none;
        }
        .month{
            float: right;
            border-top-left-radius: 4px;
            border-bottom-left-radius: 4px;
            border-left: 2px solid #f3f3f3;
            width: 24%;
            border: 2px solid #f3f3f3;
            text-align: center;
            height: 30px;
            line-height: 30px;
            /* border-right: none; */
        }
        .actives{
            background: #f3f3f3;
            color: #2a2a2a;
        }
        .daojishi{
            margin-top: 10px;
            background: #FF4954;
            /*min-height: 30px;*/
            padding: 5px 18px;
            font-size: 12px;
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .del_btn{
            width: 100%;
            background: #2A2A2A;
            font-size: 16px;
            color: #F7D558;
            font-weight: 500;
            text-align: center;
            line-height: 48px;
            height: 48px;
            /*margin-top: 25px;*/
        }
        .find_nav_box{
            height: 50px;
            width: 100%;
            display: flex;
            align-items: center;
            font-size: 12px;
            color: #C3C3C3;
            font-weight: 500;
            position: relative;
            background: #fff;
            padding: 0 18px;
            box-sizing: border-box;
        }
        .find_total{
            /*width: 32%;*/
            /* padding-left: 18px; */
        }
        .find_nav{
            width: 100%;
            display: flex;
            justify-content: space-between;
        }
        .find_nav div{
            /* width: 24%; */
            position: relative;
        }
        .find_nav_active{
            color: #2A2A2A;
        }
        .find_nav_active:after{
            content: "";
            position: absolute;
            border-bottom: 2px solid #2A2A2A;
            bottom: -16px;
            left: 0;
            width: 12px;
        }
        .dind1 {
            width: 100%;
            overflow: hidden;
            background: #F2F2F2;
        }

        .find_user_info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 18px 18px 5px 18px;
        }

        .find_user_flex {
            display: flex;
            align-items: center;
            font-size: 14px;
            color: #2A2A2A;
            font-weight: 500;
        }

        .user_info_head {
            width: 28px;
            height: 28px;
            border-radius: 100%;
            overflow: hidden;
            margin-right: 7px;
        }

        .user_info_head img {
            width: 100%;
            height: 100%;
        }

        .find_user_time {
            font-size: 12px;
            color: #B5B5B5;
            font-weight: 400;
        }

        .find_desc {
            padding: 0 18px 10px 51px;
            font-size: 14px;
            color: #6F757C;
            font-weight: 400;
        }

        .find_user_selfie {
            padding: 0px 18px 18px 0;
            margin-left: 51px;
            border-bottom: 1px solid #DFDFDF;
            display: flex;
            flex-wrap: wrap;
        }

        .find_user_selfie_img {
            width: 80px;
            height: 80px;
            margin-right: 6px;
            margin-bottom: 6px;
        }

        .find_user_selfie_img img {
            width: 100%;
            height: 100%;
            display: block;
        }
        .videoBg{
            margin: 18px;
        }
        .videoBgs {
            padding: 18px;
            width: 100%;
            height: 200px;
            box-sizing: border-box;
            /* overflow: hidden; */
        }

        .find_chazhuang_img {
            width: 100%;
            height: auto;
        }

        .find_chazhuang_img img {
            width: 100%;
            height: 100%;
            display: block;
        }

        .find_chazhuang {
            box-sizing: border-box;
            overflow: hidden;
            margin-top: 40px;
        }

        .swiper_box {
            width: 190px;
            margin-top: 40px;
            margin-bottom: -20px;
            overflow-x: scroll;
        }

        .swiper {
            width: 10000px;
            display: flex;
            overflow-x: scroll;
        }

        .swiper_item {
            width: 300px;
            height: 118px;
            background: #ccc;
            margin-right: 20px;
            overflow-x: scroll;
        }

        .swiper-container {
            margin-top: 20px!important;
            width: 100%;
            height: 118px;
            margin-bottom: -20px!important;
        }
        .swiper-wrapper{
            margin-left: 18px;
        }
        .swiper-slide {
            /* text-align: center; */
            font-size: 18px;
            background: #fff;
            min-width: 300px;
            width: auto!important;
            font-size: 10px;
            color: #6F757C;
            font-weight: 400;
            border-radius: 3px;
            margin-right: 12px!important;
        }

        .swiper-slide>div {
            height: 28px;
            border-bottom: 1px solid #DFDFDF;
            display: flex;
            align-items: center;
            margin: 0 18px;
        }

        .swiper-slide>div:last-child {
            border: none;
        }

        .swiper-slide>div>div:nth-child(1) {
            /* width: 50%; */
        }

        .swiper-slide>div>div:nth-child(2) {
            /* width: 50%; */
            padding-left: 30px;
        }

        .find_swiper_flex {
            display: flex;
            align-items: center;
        }
        .dind3{
            background: #fff;
        }
         .write_bg{
            width: 100%;
            height: 50px;
            background: #fff;
            position: absolute;
            bottom: -51px;
        }
        .jiaoyyi_list{
            background: #fff;
            padding: 0 18px;
        }
        .jiaoyyi_item{
             display: flex;
            justify-content: space-between;
            align-items: center;
            height: 80px;
            font-size: 12px;
            border-bottom: 1px solid #e2e2e2;
        }
        .jiaoyyi_one{
            width: 28px;
            height: 28px;
            border-radius: 100%;
            overflow: hidden;
        }
        .jiaoyyi_one img{
             width: 100%;
            height: 100%;
        }
        .flexs{
            display: flex;
            align-items: center;
            width: 40%;
        }
        .jiaoyyi_two{
            margin-left: 10px;
            color: #2A2A2A;
            font-weight: 600;
        }
        .jiaoyyi_three{
            color: #6F757C;
            font-weight: 500;
            text-align: right;
        }
        .jiaoyyi_four{
            color: #6F757C;
            font-weight: 500;
        }
        .jiaoyyi_five{
            color: #2A2A2A;
            font-size: 10px;
            border: 1px solid #2A2A2A;
            border-radius: 2px;
            padding: 0 10px;
            width: 40px;
            text-align: center;
        }
        .jiaoyi_ac{
            background: #000;
            color: #fff;
        }
        .jiaoyi_tab{
            background: #fff;
            padding-right: 18px;
            display: flex;
            justify-content: space-between;
            padding-top: 12px;
        }
        .jiaoyi_c_tab{
            display: flex;

            font-size: 10px;
            color: #C3C3C3;
        }
        .jiaoyi_c_tab>div{
            width: 50px;
            border: 1px solid #C3C3C3;
            text-align: center;
            margin: 0 2px;
            /*border-right: none;*/
        }
        .jiaoyi_c_tab>div:last-child{
             border-right: 1px solid #C3C3C3;
        }
        .jiaoyi_c_tab_active{
            color: #2A2A2A;
            font-weight: 600;
        }
    </style>
</head>
<body>
    <div class="FindDetails">
        <div class="downheader">
            <div class="logo_img">
                <img src="/static/pages/image/share_logo.png" alt="">
            </div>
            <a id="download" href="{{ download_link }}"><div class="down_btn">立即下载</div></a>
        </div>
    </div>
	<div class="share_data">
        <div class="share_data_child">
            <div class="share_data_one">¥{{avg_price}}</div>
            <div class="share_data_two">历史平均</div>
            <div class="share_data_three">{{product_name}}</div>
        </div>
        <div class="share_data_flex">
            <div>
                <div class="share_data_flex_one">{{ keeping_count }}</div>
                <div class="share_data_flex_two">用户持仓量</div>
            </div>
            <div>
                {% if up_down_percent_float >= 0 %}
                    <div class="share_data_flex_three red_color"> +{{ up_down_percent }}<img src="/static/pages/image/jiantouhong.png"></div>
                {% else %}
                    <div class="share_data_flex_three green_color"> {{ up_down_percent }}<img src="/static/pages/image/greendown.png"></div>
                {% endif %}

                <div class="share_data_flex_four">涨幅度</div>
            </div>
        </div>
    </div>
    <div class="line"></div>
    <div class="zhexiantu">
        <div class="zhexianTab">
            <div class="today tab actives">今日</div>
            <!-- <div class="other"> -->
            <div class="week tab">本月</div>
            <div class="month tab">本周</div>
            <!-- </div> -->
        </div>
        <div>
            <div id="container" style="width: 100%;height:200px;"></div>
        </div>
    </div>
    <div class="line"></div>
    <div class="find_nav_box">
        <div class="find_nav">
            <div class="find_total find_nav_active">交易({{ count }})</div>
            <div>简介</div>
            <div>茶庄</div>
            <div>用户评论</div>
        </div>
        <div class="write_bg" style="display: none">

            </div>
    </div>
        <div class="find_tab_box">
            <div class="dind0 finds">

                <div class="jiaoyyi_list">
                    {% for item in trade_items %}
                    <div class="jiaoyyi_item">
                        <div class="flexs">
                            <div class="jiaoyyi_one"><img src="{{item.user_avatar }}"></div>
                            <div class="jiaoyyi_two">{{ item.user_nickname }}</div>
                        </div>
                        <div class="jiaoyyi_three">{{ item.count }}</div>
                        <div class="jiaoyyi_four">¥{{ item.offered_price }}</div>
                        {% if item.intention_type == "BUY" %}
                             <span class="jiaoyyi_five">满足TA</span>
                        {% elif item.intention_type == "SELL"  %}
                        <a id="download" href="{{ download_link }}"><div class="jiaoyyi_five jiaoyi_ac">买入</div></a>
                        {% endif %}
                    </div>
                    {% endfor %}

                </div>
            </div>
            <div class="dind1 finds" style="display: none">
                {% if product.video_banner %}
                <div class="videoBg">
                    <video id="my-video" class="video-js videoBgs videoBgs1" controls preload="auto" poster="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSMkZ8908OI26Xnnsei6xpcJdMMR15Ozd7e_IBXNYzbp860vjdg"
                        data-setup="{}">
                        <source src=' {{ product.video_banner }}' type="video/mp4" />
                        <p class="vjs-no-js">
                            To view this video please enable JavaScript, and consider upgrading to a web browser that
                            <a href="https://videojs.com/html5-video-support/" target="_self">supports HTML5 video</a>
                        </p>
                    </video>
                </div>
                {% endif %}
                <div class="swiper-container">
                    <div class="swiper-wrapper">
                        <div class="swiper-slide">
                            <div>
                                <div>种类: {{ product.kind }} </div>
                                <div>年份: {{ product.age }} </div>
                            </div>
                            <div>
                                <div>规格: {{ product.specification }} </div>
                                <div>发行量: {{ product.publish_count }}  </div>
                            </div>
                            <div>原料: {{ product.material }}  </div>
                            <div>仓储库房: {{ product.repo_name }}  </div>
                        </div>
                        <div class="swiper-slide">
                            <div>
                                <div>工艺: {{ product.technology }}  </div>
                                <div>茶山: {{ product.tea_mountain }}  </div>
                            </div>
                            <div>
                                <div>海拔: {{ product.altitude }}  </div>
                                <div>年平均气温: {{ product.year_avg_temperature }}  </div>
                            </div>
                            <div>
                                <div>古树量: {{ product.ancient_tea_tree_count }}  </div>
                                <div>年平均降水: {{ product.year_avg_precipitation }}  </div>
                            </div>
                            <div>产地: {{ product.made_in }} </div>
                        </div>
                    </div>
                </div>
                <div class="find_chazhuang">
                    {% for img in product.long_images %}
                        <div class="find_chazhuang_img">
                            <img src="{{ img.img_url }}" alt="">
                        </div>
                    {% endfor %}
                </div>
            </div>
            <div class="dind2 finds" style="display: none">
                <div class="videoBg">
                    {% if store.video_banner %}
                        <video id="my-video" class="video-js videoBgs videoBgs2" controls preload="auto" poster="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSMkZ8908OI26Xnnsei6xpcJdMMR15Ozd7e_IBXNYzbp860vjdg"
                        data-setup="{}">{/*./images/vdbg.png*/}
                        <source src=' {{ store.video_banner }}' type="video/mp4" />
                        <p className="vjs-no-js">
                            To view this video please enable JavaScript, and consider upgrading to a web browser that
                            <a href="https://videojs.com/html5-video-support/" target="_self">supports HTML5 video</a>
                        </p>
                    </video>
                    {% endif %}
                </div>
                {% if store.long_images %}
                    {% for img in store.long_images %}
                         <div class="find_chazhuang">
                            <div class="find_chazhuang_img">
                                <img src="{{ img.img_url }}" alt="">
                            </div>
                        </div>
                    {% endfor %}
                {% else %}
                     {% for img in brand.long_images %}
                         <div class="find_chazhuang">
                            <div class="find_chazhuang_img">
                                <img src="{{ img.img_url }}" alt="">
                            </div>
                        </div>
                    {% endfor %}
                {% endif %}

            </div>
            <div class="dind3 finds" style="display: none">
                <div>
                    {% for comment in comments %}
                    <!--<div>{{ comment }}</div>-->
                    <div class="find_user_info">
                        <div class="find_user_flex">
                            <div class="user_info_head">
                                <img src="{{ comment.user_avatar }}" alt="">
                            </div>
                            <div>{{ comment.nickname }}</div>
                        </div>
                        <div class="find_user_time">{{ comment.add_time }}</div>
                    </div>
                    <div class="find_desc">{{ comment.content }}
                    </div>
                    <div class="find_user_selfie">
                        {% for img in comment.pictures  %}
                         <div class="find_user_selfie_img">
                            <img src="{{ img.img_url }}" alt="">
                        </div>
                        {% endfor %}
                    </div>
                     {% endfor %}
                </div>
            </div>
        </div>
    </div>
</body>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script src="https://vjs.zencdn.net/6.6.3/video.js"></script>
<script src="https://cdn.bootcss.com/Swiper/4.2.0/js/swiper.min.js"></script>
<script src="https://cdn.hcharts.cn/highcharts/highcharts.js"></script>
<script type="text/javascript">
    var line_data = [];
    var today_line_data = {{ today_price_data|safe }}
    var week_line_data = {{ week_price_data|safe }}
    var month_line_data = {{ month_price_data|safe }}
        var current = "今日";
    if(current == "今日") {
            today_line_data.points.map(function(i, v) {
                line_data.push(i.value * 1)
            })
        }
    $('.tab').click(function () {
        line_data = [];
        var i = $(this).index();//下标第一种写法
        $(this).addClass('actives').siblings().removeClass('actives');
        current = $(this).html();
        console.log(current)
        if(current == "今日") {
            today_line_data.points.map(function(i, v) {
                line_data.push(i.value * 1)
            })
            console.log(line_data)
        }else if (current == "本周") {
             week_line_data.points.map(function(i, v) {
                line_data.push(i.value * 1)
            })
             console.log(line_data)
        }else if (current == "本月") {
             month_line_data.points.map(function(i, v) {
                line_data.push(i.value * 1)
            })
             console.log(line_data)
        }
        get()
    })
 $('.find_nav div').click(function() {
        var i = $(this).index();//下标第一种写法
        $(this).addClass('find_nav_active').siblings().removeClass('find_nav_active');
        $('.find_tab_box .finds').eq(i).show().siblings().hide();
        var swiper = new Swiper('.swiper-container', {
            slidesPerView: 'auto',
            spaceBetween: 30,
            pagination: {
                el: '.swiper-pagination',
                clickable: true,
            },
        });

    });
    get()
    function get() {
            $('#container').highcharts({
                chart: {
                    height: 200,
                    type: 'line'
                },
                title: {
                    text: ''
                },
                subtitle: {
                    text: ''
                },
                credits: {
                    enabled: false
                },
                colors: ['#F3F3F3'],
                xAxis: {
                    labels: {
                        enabled: false
                    },
                },
                yAxis:{
                    labels:{
                        enabled: false
                    },
                    title: ""
                },
                series: [{
                    name: ' ',
                    data: line_data
                }]
            }, function (chart) { // on complete
                var min = 1000,
                    max = 0,
                    pointsToShow = [0, 0],
                    points = chart.series[0].points;
                Highcharts.each(points, function (p) {
                    if (p.y > max) {
                        pointsToShow[0] = p.index;
                        max = p.y;
                    }
                    if (p.y < min) {
                        pointsToShow[1] = p.index;
                        min = p.y;
                    }
                });
                render(chart, points[pointsToShow[0]], '￥');
                render(chart, points[pointsToShow[1]], '￥');
                //var point = chart.series[0].points[8];
            });
            function render(chart, point, text) {
                console.log(chart, point, text)
                chart.renderer.label(text + ' ' + point.y, point.plotX + chart.plotLeft - 20, point.plotY + chart.plotTop - 45, 'callout', point.plotX + chart.plotLeft, point.plotY + chart.plotTop)
                    .css({
                        color: '#fff',
                        align: 'center',
                        borderWidth: "5px",
                        borderColor: "red",
                        borderStyle: "solid",

                    })
                    .attr({
                        fill: 'rgba(0, 0, 0, 0.75)',
                        padding: 8,
                        r: 5,
                        zIndex: 6,
                    })
                    .add();
            }
    }



</script>


</html>